package com.edu.neusoft.elec_shop.domain;

import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Min;
import javax.validation.constraints.Size;

@Data
public class Goods {
    @NotNull(message = "商品编号不能为空")
    private Long goodsId;

    @NotBlank(message = "商品名称不能为空")
    @Size(max = 100, message = "商品名称长度不能超过100个字符")
    private String goodsName;

    @NotBlank(message = "商品价格不能为空")
    @Min(value = 0, message = "商品价格不能为负数")
    private String price;

    @NotBlank(message = "商品种类不能为空")
    private String type;

    @NotBlank(message = "商品描述不能为空")
    @Size(max = 300, message = "描述长度不能超过300个字符")
    private String description;

    @Min(value = 0, message = "商品销量不能为负数")
    private String salesCount;
}